version 18.0               // version control
set processors 8           // to ensure replicability across different numbers of cores
clear all                  // clear existing data
macro drop _all            // and macros, clean slate
set seed 20220613          // set seed

*-------------------------------------------------------
* project: daylight saving time (dst)
*-------------------------------------------------------

local pgm  "dst-data01_acs_health_ins_coverage_clean"     // file name
local who  "Muzhe Yang"                                   // author
local dte  "2022-06-13"                                   // created date
local dte2 "`c(current_date)'"                            // last run date
local tag  "`pgm'.do, created by `who' on `dte', last run on `dte2'"

capture log close
log using "code\management\\`pgm'.txt", replace text
display "`tag'"

import excel "data_raw\acs\acs_health_ins_coverage.xlsx", sheet("acs_health_ins_coverage") firstrow clear

gen double no_health_ins = B27010_calc_numNoInsE
gen double no_health_ins_pct = B27010_calc_pctNoInsE

label variable no_health_ins "population with NO health insurance coverage"
label variable no_health_ins_pct "% of population with NO health insurance coverage"

order no_health_ins no_health_ins_pct, after(County)
keep GEOID State County /// 
     no_health_ins no_health_ins_pct
codebook, compact
compress
save "data_clean\acs\\`pgm'.dta", replace 

log close
exit